package com.vm.osm.business.service.impl;

import com.vm.osm.business.common.exception.BusinessException;
import com.vm.osm.business.dao.OsmLogicNodeAttrMapper;
import com.vm.osm.business.entity.OsmLogicNodeAttr;
import com.vm.osm.business.service.IOsmLogicNodeAttrService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OsmLogicNodeAttrServiceImpl extends
        AbstractServiceImpl<OsmLogicNodeAttr, String> implements IOsmLogicNodeAttrService {
    private OsmLogicNodeAttrMapper mapper;

    public OsmLogicNodeAttrServiceImpl(OsmLogicNodeAttrMapper mapper) {
        super(mapper);
        this.mapper = mapper;
    }

    @Override
    public int deleteByNodeId(String node_id) {
        if (StringUtils.isEmpty(node_id)) throw new BusinessException("节点Id为空");
        return mapper.deleteByNodeId(node_id);
    }

    @Override
    public List<OsmLogicNodeAttr> find(Map<String, Object> params) {
        return mapper.find(params);
    }
}
